package cn.fancy.sdk.login;

import cn.fancy.sdk.common.utils.Md5;

/**
 * 返回给CP的登录结果数据包装对象
 */
public class QdLoginResult {
    
    public String userName;
    public String userId;
    public String token;
    public String time;
    public String isbind;
    public String sign;
    
    public String ormustbind;
    
    public QdLoginResult(String userId, String userName, String token, String time, String isbind, String ormustbind) {
        this.userId = userId;
        this.userName = userName;
        this.time = time;
        this.token = token;
        this.isbind = isbind;
        this.ormustbind = ormustbind;
        this.sign = Md5.md5Digest(userName + token + userId);
    }
    
    @Override
    public String toString() {
        return "{\"loginResult\":" + "{\"uid\":\"" + userId + "\",\"username\":\"" + userName
            + "\",\"token\":\"" + token + "\",\"time\":\"" + time + "\",\"isbind\":\"" + isbind + "\", \"sign\":\"" + sign + "\",\"ormustbind\":\"" + ormustbind
            + "\"}}";
    }
    
}
